/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Model
*        文件名:             BaseOrganizeEntity.cs
*        创建系统时间:       2012/11/2 19:07:03
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Model
{
    using System;
    using System.Data;
    using ECP.Utilities;

    [Serializable]
    public class BaseOrganizeEntity
    {
        private string address;
        private string assistantManager;
        private string category;
        private string code;
        private string createDate;
        private string createUserID;
        private string description;
        private bool enabled;
        private string fax;
        private string fullName;
        private string id;
        private string innerPhone;
        private bool isInnerOrganize;
        private string manager;
        private string modifyDate;
        private string modifyUserID;
        private string outerPhone;
        private string parentID;
        private string postalcode;
        private string sortCode;
        private string web;

        public BaseOrganizeEntity()
        {
            this.id = string.Empty;
            this.code = string.Empty;
            this.fullName = string.Empty;
            this.parentID = string.Empty;
            this.category = string.Empty;
            this.outerPhone = string.Empty;
            this.innerPhone = string.Empty;
            this.fax = string.Empty;
            this.manager = string.Empty;
            this.assistantManager = string.Empty;
            this.isInnerOrganize = true;
            this.postalcode = string.Empty;
            this.address = string.Empty;
            this.web = string.Empty;
            this.description = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
        }

        public BaseOrganizeEntity(DataRow dataRow)
        {
            this.id = string.Empty;
            this.code = string.Empty;
            this.fullName = string.Empty;
            this.parentID = string.Empty;
            this.category = string.Empty;
            this.outerPhone = string.Empty;
            this.innerPhone = string.Empty;
            this.fax = string.Empty;
            this.manager = string.Empty;
            this.assistantManager = string.Empty;
            this.isInnerOrganize = true;
            this.postalcode = string.Empty;
            this.address = string.Empty;
            this.web = string.Empty;
            this.description = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
            this.GetFrom(dataRow);
        }

        public BaseOrganizeEntity(DataTable dataTable)
        {
            this.id = string.Empty;
            this.code = string.Empty;
            this.fullName = string.Empty;
            this.parentID = string.Empty;
            this.category = string.Empty;
            this.outerPhone = string.Empty;
            this.innerPhone = string.Empty;
            this.fax = string.Empty;
            this.manager = string.Empty;
            this.assistantManager = string.Empty;
            this.isInnerOrganize = true;
            this.postalcode = string.Empty;
            this.address = string.Empty;
            this.web = string.Empty;
            this.description = string.Empty;
            this.sortCode = string.Empty;
            this.createUserID = string.Empty;
            this.createDate = string.Empty;
            this.modifyUserID = string.Empty;
            this.modifyDate = string.Empty;
            this.GetFrom(dataTable);
        }

        public BaseOrganizeEntity GetFrom(DataRow dataRow)
        {
            this.ID = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldID]);
            this.ParentID = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldParentID]);
            this.Code = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldCode]);
            this.FullName = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldFullName]);
            this.Category = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldCategory]);
            this.OuterPhone = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldOuterPhone]);
            this.InnerPhone = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldInnerPhone]);
            this.Fax = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldFax]);
            this.Postalcode = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldPostalcode]);
            this.Address = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldAddress]);
            this.Web = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldWeb]);
            this.Manager = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldManager]);
            this.AssistantManager = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldAssistantManager]);
            this.IsInnerOrganize = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseOrganizeTable.FieldIsInnerOrganize]);
            this.Enabled = BaseBusinessLogic.ConvertIntToBoolean(dataRow[BaseOrganizeTable.FieldEnabled]);
            this.SortCode = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldSortCode]);
            this.Description = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldDescription]);
            this.CreateUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldCreateUserID]);
            this.CreateDate = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldCreateDate]);
            this.ModifyUserID = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldModifyUserID]);
            this.ModifyDate = BaseBusinessLogic.ConvertToString(dataRow[BaseOrganizeTable.FieldModifyDate]);
            return this;
        }

        public BaseOrganizeEntity GetFrom(DataTable dataTable)
        {
            foreach (DataRow row in dataTable.Rows)
            {
                this.GetFrom(row);
                break;
            }
            return this;
        }

        public string Address
        {
            get
            {
                return this.address;
            }
            set
            {
                this.address = value;
            }
        }

        public string AssistantManager
        {
            get
            {
                return this.assistantManager;
            }
            set
            {
                this.assistantManager = value;
            }
        }

        public string Category
        {
            get
            {
                return this.category;
            }
            set
            {
                this.category = value;
            }
        }

        public string Code
        {
            get
            {
                return this.code;
            }
            set
            {
                this.code = value;
            }
        }

        public string CreateDate
        {
            get
            {
                return this.createDate;
            }
            set
            {
                this.createDate = value;
            }
        }

        public string CreateUserID
        {
            get
            {
                return this.createUserID;
            }
            set
            {
                this.createUserID = value;
            }
        }

        public string Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        public bool Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        public string Fax
        {
            get
            {
                return this.fax;
            }
            set
            {
                this.fax = value;
            }
        }

        public string FullName
        {
            get
            {
                return this.fullName;
            }
            set
            {
                this.fullName = value;
            }
        }

        public string ID
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        public string InnerPhone
        {
            get
            {
                return this.innerPhone;
            }
            set
            {
                this.innerPhone = value;
            }
        }

        public bool IsInnerOrganize
        {
            get
            {
                return this.isInnerOrganize;
            }
            set
            {
                this.isInnerOrganize = value;
            }
        }

        public string Manager
        {
            get
            {
                return this.manager;
            }
            set
            {
                this.manager = value;
            }
        }

        public string ModifyDate
        {
            get
            {
                return this.modifyDate;
            }
            set
            {
                this.modifyDate = value;
            }
        }

        public string ModifyUserID
        {
            get
            {
                return this.modifyUserID;
            }
            set
            {
                this.modifyUserID = value;
            }
        }

        public string OuterPhone
        {
            get
            {
                return this.outerPhone;
            }
            set
            {
                this.outerPhone = value;
            }
        }

        public string ParentID
        {
            get
            {
                return this.parentID;
            }
            set
            {
                this.parentID = value;
            }
        }

        public string Postalcode
        {
            get
            {
                return this.postalcode;
            }
            set
            {
                this.postalcode = value;
            }
        }

        public string SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        public string Web
        {
            get
            {
                return this.web;
            }
            set
            {
                this.web = value;
            }
        }
    }
}